package com.juai.centralkitchen.adapter;

import android.content.Context;
import android.widget.ImageView;


import com.bridge.common.bean.MessageBean;
import com.juai.centralkitchen.R;
import com.zhy.adapter.recyclerview.CommonAdapter;
import com.zhy.adapter.recyclerview.base.ViewHolder;

import java.util.ArrayList;
import java.util.List;


/**
 * @ClassName MyApp
 * @Description TODO 消息adapter
 * @Author biekangdong
 * @CreateDate 2021/4/16 18:26
 * @Version 1.0
 * @UpdateDate 2021/4/16 18:26
 * @UpdateRemark 更新说明
 */
public class MessageListAdapter extends CommonAdapter<MessageBean.DataBean.ListBean> {

    private Context mContext;
    private List<MessageBean.DataBean.ListBean> mList = new ArrayList<>();

    public MessageListAdapter(Context context, int layoutId, List<MessageBean.DataBean.ListBean> data) {
        super(context, layoutId, data);
        mContext = context;
        mList.clear();
        mList.addAll(data);
    }

    public void setData(List<MessageBean.DataBean.ListBean> data) {
        mList = data;
    }

    @Override
    protected void convert(ViewHolder holder, MessageBean.DataBean.ListBean dataBean, int position) {
        holder.setText(R.id.tv_number, dataBean.getOrderId());
        holder.setText(R.id.tv_time, dataBean.getCreateTime());
        holder.setText(R.id.tv_name, dataBean.getUserName());
        holder.setText(R.id.tv_money, "¥"+dataBean.getOrderAmount());
    }

}